Repository navigation
test(redis): fix the security handshake mock for redis-py 8.2 - #3393
Merged
Merged
Conversation
Sehat1137
previously approved these changes
Nov 23, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 23, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 24, 2026
Redis 8.12 refuses to start a cluster with an unauthenticated bus by default. Bind the test nodes to loopback and explicitly allow the local plaintext bus in CI and Compose. Print the container logs if CI times out waiting for the cluster.
borisalekseev
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
redis-py 8.2 checks whether the asyncio transport is closing before writing a command. The Redis security examples used a bare
MagicMock, so the client treated the connection as closed before it could authenticate. The TLS-only test passed even when its ping returned false. Failing CI jobThe test transport now stays open and feeds replies to a real
StreamReaderas redis-py sends commands.The tests assert a successful ping and an authentication error using the client's default protocol.
Evidence
Ran both cases in
tests/docs/redis/test_security.pyon Python 3.13.ConnectionErrorRuff and mypy passed on the changed file. An additional check on 5.0.0 failed on both revisions because FastStream calls
Redis.from_poolbefore opening the connection.Merge Danger
Reverting this test-only change restores the previous mock.
Codex assisted with the patch and ran the checks above.